package com.rs.game.player.dialogues.impl;

import com.rs.game.player.dialogues.Dialogue;

public class GEClerk extends Dialogue {
    int npcId;

    @Override
    public void start() {
	npcId = (Integer) parameters[0];
	sendNPCDialogue(npcId, 9827, "Good day, how may I help you?");
    }

    @Override
    public void run(int interfaceId, int componentId) {
	if (stage == -1) {
	    stage = 0;
	    sendOptionsDialogue("What would you like to say?", "I'd like to use the GrandExchange.", "I'd like to access my bank account.", "I'd like to see my collection box.", "Who are you?");
	} else if (stage == 0) {
	    if (componentId == OPTION_1) {
		   player.getGeManager().openGrandExchange();
		end();
	    } else if (componentId == OPTION_2) {
			player.getBank().openBank();
			end();
	    } else if (componentId == OPTION_3) {
		    player.getGeManager().openCollectionBox();
		end();
	    } else if (componentId == OPTION_4) {
		stage = 1;
		sendPlayerDialogue(9827, "Who are you?");
	    } else
		end();
	} else if (stage == 1) {
	    stage = 2;
	    sendNPCDialogue(npcId, 9827, "I'm the Grand Exchange Clerk.");
	} else if (stage == 2) {
	    stage = 3;
	    sendPlayerDialogue(9827, "What is the Grand Exchange?");
	} else if (stage == 3) {
	    sendNPCDialogue(npcId, 9827, "The Grand Exchange is a trading system for players to buy and sell from each other almost every tradeable item.");
	    stage = 4;
	} else if (stage == 4) {
	    stage = 5;
	    sendPlayerDialogue(9827, "Okay. Thank you.");
	} else if (stage == 5) {
	    end();
	} else
	    end();
    }

    @Override
    public void finish() {

    }

}
